package by.myteam.gonki.bo.enemy;

import java.awt.Toolkit;
import java.util.Random;

import by.myteam.gonki.bo.IDrawable;
import by.myteam.gonki.logic.GameLogic;

public class WallEnemy extends Enemy implements IDrawable{

	public WallEnemy(){
		ENEMY_HEIGHT = 150;
		ENEMY_WIDTH = 30;
		PNG = "graph/wall.png";
		WALL = Toolkit.getDefaultToolkit().getImage(PNG);
		DAMAGE = 20;
		SLOWDOWN = 40;
		VANISH = true;
		PERIOD = 30;
		PATH = 0;
		random = new Random();
		StartRandomObjects();
	}

	@Override
	public void appearsLogic() {
		PATH += GameLogic.INSTANCE.getSpeed();
		if(PATH > 200 - PERIOD && random.nextInt(100) < PERIOD){
			enemyFactory.createEnemy(EEnemy.WALL);
			PATH = 0;
		}; 		
	}

}
